package com.course.service.impl;

import com.course.mapper.PermissionMapper;
import com.course.entity.Permission;
import com.course.service.IPermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * 后台用户权限表(访问资源页面功能标识，API接口等) 服务实现类
 * </p>
 *
 * @author author
 * @since 2022-09-16
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements IPermissionService {

    @Override
    public List<Permission> getPermissionByRoleIds(List<String> ids) {
        String collect = ids.stream().collect(Collectors.joining(","));
        return this.getBaseMapper().getRolePermissions(collect);
    }
}
